<?php
session_start();

$output = array();

require("framework/config.php");

date_default_timezone_set(DEFAULT_TIMEZONE);

if(INCLUDE_FRAMEWORK_HELPERS) {
    require(HELPERS_PATH . "framework_helpers.php");
    start_execution_time();
    //ini_set("display_errors", false);
    set_error_handler("php_fw_error_handler");
    set_exception_handler("php_fw_exception_handler");
}
if(INCLUDE_FORM_HELPERS) {
    require(HELPERS_PATH . "form_helpers.php");
}
if(INCLUDE_FORMIFIER) {
  require(HELPERS_PATH . "Formifier.php");
}
if(INCLUDE_HTML_HELPERS) {
    require(HELPERS_PATH . "html_helpers.php");
}
if(INCLUDE_APPLICATION_HELPERS) {
    require(HELPERS_PATH . "application_helpers.php");
}

/*
    * Core includes
*/

include_core_library("MySQL");
include_core_library("ModelBase");
include_core_library("ControllerBase");
include_core_library("Paginator");
include_core_library("Authorizator");
if(INCLUDE_GENERATORS and !IS_PRODUCTION) {
  include_core_library("Gnrt");
  include_core_library("GnrtController");
}

/*
    * Plugin includes
*/

/*
    * Objects that will be avilable throught out the application
*/

$db = new MySQL();

/*
    * Enables all routing and scripts
*/

require(FRAMEWORK_PATH . "routes.php");
?>